import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import Register from "@/views/Register";
import FindPass from "@/views/FindPass";
import Login from "@/views/Login";
import Logto from "@/views/Logto";
import indexView from "../views/indexView";
import myView from "@/views/MyView";
import Order from "@/views/Order";
import cart from "@/views/Cart";
import StoreView from "@/views/StoreView";
import StoreListView from "@/views/StoreListView";
import My from "@/views/My";
import Chat from "@/views/Chat";
import Pay from "@/views/Pay";
import QueryOrder from "@/views/QueryOrder";
import login from "@/views/Login";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'lin',
    component: login,
    meta: {
      footShow: true, // true显示，false隐藏
    }
  },

  // {
  //   path: '/reg',
  //   name: 'reg',
  //   component:
  // },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/find',
    name: 'find',
    component: FindPass
  },
  {
    path: '/lin',
    name: 'lin',
    component: Login
  },
  {
    path: '/lto',
    name: 'lto',
    component: Logto
  },
  {
    path: '/order',
    name: 'order',
    component: Order
  },
  {
    path: '/cart',
    name: 'cart',
    component: cart,
    meta: {
      footShow: true, // true显示，false隐藏
    }
  },
  {
    path: '/index',
    name: 'index',
    component: indexView
  },
  {
    path: '/my',
    name: 'my',
    component: myView
  },
  {
    path: '/m',
    name: 'm',
    component: My
  },
  {
    path: '/chat',
    name: 'chat',
    component: Chat
  },
  {
    path: '/queryorder',
    name: 'queryorder',
    component: QueryOrder
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/storeList',
    name: 'storeList',
    component: StoreListView
  },
  {
    path: '/store',
    name: 'store',
    component: StoreView
  },
  {
    path: '/pay',
    name: 'pay',
    component: Pay,
    meta: {
      footShow: true, // true显示，false隐藏
    }
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
